import { Base } from '../../utils/base.js'
class Center extends Base {
  constructor() {
    super();
  }

  /*更新用户信息到服务器*/
  _updateUserInfo(user,cb) {
    var that=this;
    var allParams = {
      url: 'xcx-member/xcx-update-member',
      data: {'data': JSON.stringify(user)},
      type: 'post',
      sCallback: function (res) {
        cb&&cb(res)
      }
    };
    this.request(allParams);
  }
  //账户明细
  getAccountsList(param,cb) {
    var page = param.page ? param.page : 1;
    var that = this;
    var allParams = {
      url: 'member/account-log?page=' + page,
      data: param,
      type: 'post',
      sCallback: function (res) {
        cb && cb(res)
      }
    };
    this.request(allParams);
  }
  //余额，卡包，积分概况
  index(param, cb) {
    var that = this;
    var allParams = {
      url: 'member/index',
      data: param,
      type: 'post',
      sCallback: function (res) {
        cb && cb(res)
      }
    };
    this.request(allParams);
  }
  //申请提现
  withdraw(param, cb) {
    var that = this;
    var allParams = {
      url: 'pay/withdrawal',
      data: param,
      type: 'post',
      sCallback: function (res) {
        cb && cb(res)
      }
    };
    this.request(allParams);
  }
}
export { Center }